package com.esri.core.analysis;

import android.util.Log;
import com.esri.android.map.Layer;
import com.esri.android.map.event.OnStatusChangedListener;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.map.AnalysisLayerInternal;

/* loaded from: classes.dex */
public class a extends Layer {
    private LineOfSight a;

    public a(LineOfSight lineOfSight) {
        this.a = lineOfSight;
        initLayer();
    }

    @Override // com.esri.android.map.Layer
    protected long create() {
        return AnalysisLayerInternal.a();
    }

    @Override // com.esri.android.map.Layer
    protected void initLayer() {
        if (this.nativeHandle == 0) {
            this.nativeHandle = create();
        }
        if (this.nativeHandle == 0 || this.a.getId() == 0) {
            changeStatus(OnStatusChangedListener.STATUS.fromInt(-1000));
            return;
        }
        try {
            AnalysisLayerInternal.a(this.nativeHandle, this.a.getId());
            setDefaultSpatialReference(AnalysisLayerInternal.a(this.nativeHandle, SpatialReference.WKID_WGS84) ? SpatialReference.create(SpatialReference.WKID_WGS84) : null);
            setFullExtent(getFullExtent());
            changeStatus(OnStatusChangedListener.STATUS.INITIALIZED);
        } catch (Exception e) {
            Log.e(com.esri.core.internal.a.a, "url = " + getUrl(), e);
            changeStatus(OnStatusChangedListener.STATUS.fromInt(-1000));
        }
    }
}
